<!DOCTYPE html>
<html lang="en">
{%  load staticfiles %}
<head>
    <meta charset="UTF-8">
    <meta name="description" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- The above 4 meta tags *Must* come first in the head; any other head content must come *after* these tags -->

    <!-- Title -->
    <title>主页</title>

    <!-- Stylesheet -->
    <link rel="stylesheet" href="http://www.rpcomputationalbiology.cn/static/style.css">
    <link rel="stylesheet" href="http://www.rpcomputationalbiology.cn/static/css/button.css">
    <!-- Bootstrap core CSS -->
    <link href="/static/css/index/bootstrap.min.css" rel="stylesheet">
    <link href="https://img.jigao616.com/css/style.css" rel="stylesheet">
    <link href="https://img.jigao616.com/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/css/common/common.css" rel="stylesheet">

    <script type="text/javascript" src="/static/script/map/echarts.min.js"></script>
    <script src="{% static 'script/common/jquery-3.1.1.min.js' %}"></script>
    <script src="https://img.jigao616.com/js/html5shiv.min.js"></script>
    <script src="/static/script/common/common.js"></script>
    <script src="/static/script/index/index.js"></script>

</head>
<body>
<header class="header-area">
    <!-- Top Header Area -->
    <div class="top-header-area d-flex justify-content-between align-items-center">
    </div>
    <!-- Navbar Area -->
    <div id="sticky-wrapper" class="sticky-wrapper is-sticky" style="height: 80px;">
        <div class="clever-main-menu" style="width: 100%; position: fixed; top: 0px; z-index: inherit;">
        <div class="classy-nav-container light left breakpoint-off">
            <!-- Menu -->
            <nav class="classy-navbar justify-content-between" id="cleverNav">

                <!-- Logo -->
                <a class="nav-brand" href="/index"><img src="{% static 'image/logo1.png' %}" alt=""></a>

                <!-- Navbar Toggler -->
                <div class="classy-navbar-toggler">
                    <span class="navbarToggler"><span></span><span></span><span></span></span>
                </div>

                <!-- Menu -->
                <div class="classy-menu">

                    <!-- Close Button -->
                    <div class="classycloseIcon">
                        <div class="cross-wrap"><span class="top"></span><span class="bottom"></span></div>
                    </div>

                    <!-- Nav Start -->
                    <div class="classynav">
                        <ul>
                            <li><a href="/index">主页</a></li>
                            <li ><a href="/visual">例子</a>
                            <li ><a href="/mysystem">预测</a>
                            <li><a href="/incidence">发病情况</a></li>
                            <li><a href="/inform/inform">研究现状</a></li>
                            <li><a href="/upfile">上传</a></li>
                        </ul>

<!--                        &lt;!&ndash; Search Button &ndash;&gt;-->
<!--                        <div class="register-login-area">-->
<!--                            <a href="/analysis" class="btn active">Run TPP</a>-->
<!--                        </div>-->

                        <!-- Register / Login -->
<!--                        <div class="register-login-area">-->
<!--                            <a href="/user/register" class="btn">注册</a>-->
<!--                            <a href="/user/login" class="btn">登录</a>-->
<!--                        </div>-->

                    </div>
                    <!-- Nav End -->
                </div>
            </nav>
        </div>
    </div></div>
</header>

<div class="container" >
    <div class="col-box">
        <div class="col-box-header" style="height:500px">
            <div id="PanelZhongshuju">

                <div class="box-header-h3">实时获取天气及污染指数等数据</div>
<!--                <input type="submit" value="获取">-->
                <div class="box-header-h5">
                    <input name="Button1" value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;获取&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"  id="btn" class="btn btn-submit">
                </div>
                <br/>

                <table  id="tb" class="table">

                </table>
            </div>
        </div>

    </div>
</div>

<div class="footer">
            <p>
<!--                <a href="javascript:void(0)">关于我们</a>-->
                <a href="/aboutus">关于我们</a>
                <span class="line">|</span>
                <a href="javascript:void(0)">联系我们</a>
                <span class="line"></span>
            </p>
            <p>Copyright © 2018 All Rights Reserved. </p>
            <p> <a href="javascript:void(0)" target="_blank" rel="nofollow">XICP备xxxxx号-x</a>公网安备 xxxxxxxxxx号 归XXX所有</p>
         </div>
</body>

<script>

    $("#btn").click(function(){
     var ddata;
    $.ajax({
            url: {% url 'get_tianqidata' %},
            type: "POST",
            async: false,
            data: {},
            success: function (data) {
                data = JSON.parse(data);
                ddata = data;
            }
        });

        var testdiv = document.getElementById("tb");
        var zon="";

        zon = '<tr>'+
            '<th>AQI指数</th>'+
            '<th>PM2.5</th>'+
            '<th>PM10</th>'+
           '<th>CO</th>'+
            '<th>NO2</th>'+
            '<th>SO2</th>'+
            '<th>O3</th>'+
            '<th>天气状况</th>'+
            '<th>风向风速</th>'+
            '<th>实时温度</th>'+
            '<th>相对湿度</th>'+
        '</tr>'
        zon = zon+'<tr>'+
            '<th>'+ddata[1][0]+'</th>'+
            '<th>'+ddata[1][1]+'</th>'+
            '<th>'+ddata[1][2]+'</th>'+
           '<th>'+ddata[1][3]+'</th>'+
            '<th>'+ddata[1][4]+'</th>'+
            '<th>'+ddata[1][5]+'</th>'+
            '<th>'+ddata[1][6]+'</th>'+
            '<th>'+ddata[1][7]+'</th>'+
            '<th>'+ddata[1][8]+'</th>'+
            '<th>'+ddata[1][9]+'</th>'+
            '<th>'+ddata[1][10]+'</th>'+
        '</tr>'

        testdiv.innerHTML=zon;
    });




</script>


</html>